package com.xy.biz.ts.domain.converter;

import com.xy.biz.ts.domain.bo.ExaminationQuestionOptionBO;
import com.xy.biz.ts.domain.po.ExaminationQuestionOptionPO;
import com.xy.biz.ts.domain.req.SaveExaminationQuestionOptionRequest;
import com.xy.biz.ts.domain.resp.GetExaminationQuestionOptionResponse;
import com.xy.tool.util.BeanUtilsEx;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author wwj
 * @date 2021-3-18
 */
public class ExaminationQuestionOptionConverter {

	public static ExaminationQuestionOptionPO toPO(ExaminationQuestionOptionBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ExaminationQuestionOptionPO(), true);
	}

	public static List<ExaminationQuestionOptionPO> toPO(Collection<ExaminationQuestionOptionBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ExaminationQuestionOptionPO(), true);
	}

	public static ExaminationQuestionOptionBO fromPO(ExaminationQuestionOptionPO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ExaminationQuestionOptionBO());
	}

	public static List<ExaminationQuestionOptionBO> fromPO(Collection<ExaminationQuestionOptionPO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ExaminationQuestionOptionBO());
	}

//	public static ExaminationQuestionOptionBO toBO(SaveExaminationQuestionOptionRequest source) {
//		return BeanUtilsEx.copyProperties(source, () -> new ExaminationQuestionOptionBO(), true);
//	}
//
	public static List<ExaminationQuestionOptionBO> toBO(Collection<SaveExaminationQuestionOptionRequest> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ExaminationQuestionOptionBO(), true);
	}
//
//	public static GetExaminationQuestionOptionResponse toResponse(ExaminationQuestionOptionBO source) {
//		return BeanUtilsEx.copyProperties(source, () -> new GetExaminationQuestionOptionResponse());
//	}
//
	public static List<GetExaminationQuestionOptionResponse> toResponse(Collection<ExaminationQuestionOptionBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetExaminationQuestionOptionResponse());
	}
//
//	public static ExaminationQuestionOptionQuery toQuery(ListExaminationQuestionOptionRequest source) {
//		if(null == source) {
//			return null;
//		}
//		ExaminationQuestionOptionQuery target = new ExaminationQuestionOptionQuery(source.getPageIndex(), source.getPageSize());
//		BeanUtilsEx.copyProperties(source, target);
//		return target;
//	}

}
